//
//  UINavigationController.swift
//  Documentation
//
//  Created by Toj on 2/7/23.
//

extension UINavigationController {

    
    /**
     UINavigationController manages a stack of view controllers and a navigation bar.
     It performs horizontal view transitions for pushed and popped views while keeping the navigation bar in sync.
     
     Most clients will not need to subclass UINavigationController.
     
     If a navigation controller is nested in a tab bar controller, it uses the title and toolbar attributes of the bottom view controller on the stack.
     
     UINavigationController is rotatable if its top view controller is rotatable.
     Navigation between controllers with non-uniform rotatability is currently not supported.
    */
    public enum Operation : Int {

        
        case none = 0

        case push = 1

        case pop = 2
    }

    
    public class let hideShowBarDuration: CGFloat
}

@available(iOS 2.0, *)
open class UINavigationController : UIViewController {

    
    /* Use this initializer to make the navigation controller use your custom bar class.
       Passing nil for navigationBarClass will get you UINavigationBar, nil for toolbarClass gets UIToolbar.
       The arguments must otherwise be subclasses of the respective UIKit classes.
     */
    @available(iOS 5.0, *)
    public init(navigationBarClass: AnyClass?, toolbarClass: AnyClass?)

    
    public init(rootViewController: UIViewController) // Initializer that also pushes the root view controller without animation.

    
    public init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) // Initializes the navigation controller with an empty stack

    
    public init?(coder aDecoder: NSCoder)

    
    open func pushViewController(_ viewController: UIViewController, animated: Bool) // Uses a horizontal slide transition. Has no effect if the view controller is already in the stack.

    
    open func popViewController(animated: Bool) -> UIViewController? // Returns the popped controller.

    open func popToViewController(_ viewController: UIViewController, animated: Bool) -> [UIViewController]? // Pops view controllers until the one specified is on top. Returns the popped controllers.

    open func popToRootViewController(animated: Bool) -> [UIViewController]? // Pops until there's only a single view controller left on the stack. Returns the popped controllers.

    
    open var topViewController: UIViewController? { get } // The top view controller on the stack.

    open var visibleViewController: UIViewController? { get } // Return modal view controller if it exists. Otherwise the top view controller.

    
    open var viewControllers: [UIViewController] // The current view controller stack.

    
    @available(iOS 3.0, *)
    open func setViewControllers(_ viewControllers: [UIViewController], animated: Bool) // If animated is YES, then simulate a push or pop depending on whether the new top view controller was previously in the stack.

    
    open var isNavigationBarHidden: Bool

    open func setNavigationBarHidden(_ hidden: Bool, animated: Bool) // Hide or show the navigation bar. If animated, it will transition vertically using UINavigationControllerHideShowBarDuration.

    open var navigationBar: UINavigationBar { get } // The navigation bar managed by the controller. Pushing, popping or setting navigation items on a managed navigation bar is not supported.

    
    @available(iOS 3.0, *)
    open var isToolbarHidden: Bool // Defaults to YES, i.e. hidden.

    @available(iOS 3.0, *)
    open func setToolbarHidden(_ hidden: Bool, animated: Bool) // Hide or show the toolbar at the bottom of the screen. If animated, it will transition vertically using UINavigationControllerHideShowBarDuration.

    @available(iOS 3.0, *)
    open var toolbar: UIToolbar! { get } // For use when presenting an action sheet.

    
    weak open var delegate: UINavigationControllerDelegate?

    @available(iOS 7.0, *)
    open var interactivePopGestureRecognizer: UIGestureRecognizer? { get }

    
    @available(iOS 8.0, *)
    open func show(_ vc: UIViewController, sender: Any?) // Interpreted as pushViewController:animated:

    
    /// When the keyboard appears, the navigation controller's navigationBar toolbar will be hidden. The bars will remain hidden when the keyboard dismisses, but a tap in the content area will show them.
    @available(iOS 8.0, *)
    open var hidesBarsWhenKeyboardAppears: Bool

    /// When the user swipes, the navigation controller's navigationBar & toolbar will be hidden (on a swipe up) or shown (on a swipe down). The toolbar only participates if it has items.
    @available(iOS 8.0, *)
    open var hidesBarsOnSwipe: Bool

    /// The gesture recognizer that triggers if the bars will hide or show due to a swipe. Do not change the delegate or attempt to replace this gesture by overriding this method.
    @available(iOS 8.0, *)
    open var barHideOnSwipeGestureRecognizer: UIPanGestureRecognizer { get }

    /// When the UINavigationController's vertical size class is compact, hide the UINavigationBar and UIToolbar. Unhandled taps in the regions that would normally be occupied by these bars will reveal the bars.
    @available(iOS 8.0, *)
    open var hidesBarsWhenVerticallyCompact: Bool

    /// When the user taps, the navigation controller's navigationBar & toolbar will be hidden or shown, depending on the hidden state of the navigationBar. The toolbar will only be shown if it has items to display.
    @available(iOS 8.0, *)
    open var hidesBarsOnTap: Bool

    /// The gesture recognizer used to recognize if the bars will hide or show due to a tap in content. Do not change the delegate or attempt to replace this gesture by overriding this method.
    @available(iOS 8.0, *)
    unowned(unsafe) open var barHideOnTapGestureRecognizer: UITapGestureRecognizer { get }
}
